package com.yihang.jdbcDemo.web;

import com.alibaba.fastjson.JSON;
import com.yihang.jdbcDemo.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @version v1.0
 * @类描述：
 * @项目名称：
 * @包名： com.yihang.jdbcDemo.web
 * @类名称：Demo
 * @创建人：YIHANG.XU
 * @创建时间：2020/12/11下午4:49
 * @修改人：YIHANG.XU
 * @修改时间：2020/12/11下午4:49
 * @修改备注：
 * @Copyright
 */
@RestController
public class Demo {
    @Autowired
    private DemoService demoService;

    @GetMapping("/add")
    public String add(){
        demoService.add();
        return "测试完成";

    }

    public static void main(String[] args) {
        List<M3u8Vo> list = new ArrayList<>();
        M3u8Vo m3u8Vo1 = new M3u8Vo();
        m3u8Vo1.setName("小布达拉宫");
        m3u8Vo1.setUrl("https://gcalic.v.myalicdn.com/gc/bsszxbdlg_1/index.m3u8?contentid=2820180516001");
        M3u8Vo m3u8Vo2 = new M3u8Vo();
        m3u8Vo2.setName("嘉峪关长城");
        m3u8Vo2.setUrl("https://gctxyc.liveplay.myqcloud.com/gc/jyg04_1/index.m3u8?contentid=2820180516001");
        M3u8Vo m3u8Vo3 = new M3u8Vo();
        m3u8Vo3.setName("贡嘎雪山");
        m3u8Vo3.setUrl("https://gctxyc.liveplay.myqcloud.com/gc/emsyh_1/index.m3u8?contentid=2820180516001");
        M3u8Vo m3u8Vo4 = new M3u8Vo();
        m3u8Vo4.setName("玉龙雪山");
        m3u8Vo4.setUrl("https://gcalic.v.myalicdn.com/gc/ljgcwglytylxs_1/index.m3u8?contentid=2820180516001");
        list.add(m3u8Vo1);
        list.add(m3u8Vo2);
        list.add(m3u8Vo3);
        list.add(m3u8Vo4);
        String s = JSON.toJSONString(list);
        System.out.println(s);
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append("d").append("d").toString();

    }

}
